package com.sl.service;

import com.sl.mapper.CompanyItemsMapper;
import com.sl.pojo.CompanyItems;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CompanyItemsService  {
    @Resource
    private CompanyItemsMapper companyItemsMapper;

    //查询：主键
    public CompanyItems findByIdItems(Integer id){
        return  companyItemsMapper.selectByPrimaryKey(id);

    }
    //查询：所有
    public List<CompanyItems> findAllItems(){
        List<CompanyItems> companyItemsList = companyItemsMapper.selectAll();
        return  companyItemsList;
    }

    //增加
    public void addCompanyItems(CompanyItems companyItems){
        companyItemsMapper.insertSelective(companyItems);
    }
    //修改
    public void updateItems(CompanyItems companyItems){
        companyItemsMapper.updateByPrimaryKeySelective(companyItems);
    }

    public void deleteByIdItems(CompanyItems companyItems) {
        companyItemsMapper.deleteByPrimaryKey(companyItems);
    }






}
